<html>

<head>
<title>JavaScript Demo</title>
<script type="text/javascript">
function run() {
    var c = document.getElementById("content");
    var n = document.createElement("p"); 
    
    var demo = new Demo("John", "Mary");
           
    n.appendChild(document.createTextNode(demo.showMessage()));
    c.appendChild(n);
}

function Demo(a, b) {
    this.a = a;
    this.b = b;
}

Demo.prototype.showMessage = function() {
    return "Demo is " + this.a + ", " + this.b;
}        
</script>
</head>

<body>
<input id="b" type="button" value="RUN" onclick="run();">
<div id="content"></div>
</body>

</html>
